<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增生产批次')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-erpBatchInfo-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">生产订单：</label>
                <div class="col-sm-8">
                    <input name="orderNo" type="hidden">
                    <input name="orderNoLabel" readonly onclick="openSelectOrder()" placeholder="点击选择" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">生产型号：</label>
                <div class="col-sm-8">
                    <input name="modelNo" readonly class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">销售员ID：</label>
                <div class="col-sm-8">
                    <input name="salesmanNo" readonly  class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">客户编号：</label>
                <div class="col-sm-8">
                    <input name="customerNo" readonly class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">批次状态：</label>
                <div class="col-sm-8">
                    <select name="state" class="form-control m-b" th:with="type=${@dict.getType('erp_batch_state')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产优先级：</label>
                <div class="col-sm-8">
                    <select name="batchPriority" class="form-control m-b" th:with="type=${@dict.getType('erp_process_level')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">长：</label>
                <div class="col-sm-8">
                    <input name="length" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">宽：</label>
                <div class="col-sm-8">
                    <input name="wide" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">PNL长：</label>
                <div class="col-sm-8">
                    <input name="pnlLength" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">PNL宽：</label>
                <div class="col-sm-8">
                    <input name="pnlWide" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">PCS数：</label>
                <div class="col-sm-8">
                    <input name="pcsNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">连片数量：</label>
                <div class="col-sm-8">
                    <input name="continuousNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">连片数量：</label>
                <div class="col-sm-8">
                    <input name="deliveryNum" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">投料数量：</label>
                <div class="col-sm-8">
                    <input name="feedNum" class="form-control" type="number" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开料日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="cuttingTime" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">当前工序状态：</label>
                <div class="col-sm-8">
                    <select name="processState" class="form-control m-b" th:with="type=${@dict.getType('erp_process_state')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">PNL总数：</label>
                <div class="col-sm-8">
                    <input name="pnlTotalNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">欠料：</label>
                <div class="col-sm-8">
                    <input name="qlNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开料：</label>
                <div class="col-sm-8">
                    <input name="klNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">压合：</label>
                <div class="col-sm-8">
                    <input name="yhNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">钻孔：</label>
                <div class="col-sm-8">
                    <input name="zkNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">导电胶：</label>
                <div class="col-sm-8">
                    <input name="ddjNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">线路：</label>
                <div class="col-sm-8">
                    <input name="xlNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">线检：</label>
                <div class="col-sm-8">
                    <input name="xjNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">图电：</label>
                <div class="col-sm-8">
                    <input name="tdNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">蚀检：</label>
                <div class="col-sm-8">
                    <input name="sjNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">中测：</label>
                <div class="col-sm-8">
                    <input name="zcNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">阻焊：</label>
                <div class="col-sm-8">
                    <input name="zhNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">阻检：</label>
                <div class="col-sm-8">
                    <input name="zjNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">字符文字：</label>
                <div class="col-sm-8">
                    <input name="zfwzNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">表面：</label>
                <div class="col-sm-8">
                    <input name="bmclNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二钻：</label>
                <div class="col-sm-8">
                    <input name="ezNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">大板飞针：</label>
                <div class="col-sm-8">
                    <input name="dbfzNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">成型外形：</label>
                <div class="col-sm-8">
                    <input name="cxwxNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">测试：</label>
                <div class="col-sm-8">
                    <input name="testNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">FQC：</label>
                <div class="col-sm-8">
                    <input name="fqcNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">已入库：</label>
                <div class="col-sm-8">
                    <input name="yrkNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">已出库：</label>
                <div class="col-sm-8">
                    <input name="yckNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">已完结：</label>
                <div class="col-sm-8">
                    <input name="ywjNum" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">累计入库：</label>
                <div class="col-sm-8">
                    <input name="rkTotal" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单面积：</label>
                <div class="col-sm-8">
                    <input name="orderArea" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生产面积：</label>
                <div class="col-sm-8">
                    <input name="prdArea" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">在线PNL：</label>
                <div class="col-sm-8">
                    <input name="linePnl" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">在线面积：</label>
                <div class="col-sm-8">
                    <input name="lineArea" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/erpBatchInfo"
        $("#form-erpBatchInfo-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-erpBatchInfo-add').serialize());
            }
        }

        $("input[name='cuttingTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            todayBtn: true,
            todayHighlight: true,
            keyboardNavigation: true,
            minuteStep: 1,
            autoclose: true
        });

        // 选择订单
        function openSelectOrder() {
            var url = ctx + "../../erp/erpOrder/pageSelectOrder";
            var options = {
                title: '选择订单',
                width:1200,
                url: url,
                callBack: doSelectOrderSubmit
            };
            $.modal.openOptions(options);
        }

        function doSelectOrderSubmit(index, layero) {
            var body = layer.getChildFrame('body', index);
            var orderNo = body.find('#orderNo').val();
            var customerNo = body.find('#customerNo').val();
            var salesmanNo = body.find('#salesmanNo').val();
            var modeNo = body.find('#modeNo').val();
            layer.close(index);
            if (orderNo != "" && orderNo != undefined) {
                $("input[name='orderNo']").val(orderNo);
                $("input[name='modelNo']").val(modeNo);
                $("input[name='customerNo']").val(customerNo);
                $("input[name='salesmanNo']").val(salesmanNo);
                $("input[name='orderNoLabel']").val(orderNo + '-' + customerNo);
            }
        }
    </script>
</body>
</html>